﻿using System.Web;

//Gallio and MbUnit Framework
using MbUnit.Framework;

//MoQ Framework

namespace MockingBird.Simulator.Framework.Tests
{
    using MockingBird.Simulator.Framework;
    using MockingBird.Simulator.Framework.Configuration;
    using MockingBird.Simulator.FunctionalTests.Common;

    [TestFixture]
    public class ContextInitializationFixture
    {
        /// <summary>
        /// When there is a valid http Context, the operation context gets initialized correctly
        /// </summary>
        [Test]
        public void ExpectExecutionContextIsInitializedFromHttpContext()
        {
            TestHelper.SetupSimulatedHttpEnvironment();
            IConfigurationDataProvider configProvider = new NativeConfigurationDataProvider();
            var executionContext = new ExecutionContext(new ApplicationConfiguration(configProvider), HttpContext.Current);
            //just a couple of things need to be tested to be sure that execution context was built correctly
            Assert.IsNotNull(executionContext);
            Assert.AreEqual(TestHelper.DEFAULT_PHYSICAL_APPLICATION_PATH + "\\", executionContext.PhysicalApplicationPath);
        }
    }
}
